
package com.carsite.service.impl;

import java.util.List;

import com.carsite.service.impl.BaseManager;
import com.carsite.model.Order;
import com.carsite.dao.OrderDao;
import com.carsite.service.OrderManager;

public class OrderManagerImpl extends BaseManager implements OrderManager {
    private OrderDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setOrderDao(OrderDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.carsite.service.OrderManager#getOrders(com.carsite.model.Order)
     */
    public List getOrders(final Order order) {
        return dao.getOrders(order);
    }

    /**
     * @see com.carsite.service.OrderManager#getOrder(String orderId)
     */
    public Order getOrder(final String orderId) {
        return dao.getOrder(new Long(orderId));
    }

    /**
     * @see com.carsite.service.OrderManager#saveOrder(Order order)
     */
    public void saveOrder(Order order) {
        dao.saveOrder(order);
    }

    /**
     * @see com.carsite.service.OrderManager#removeOrder(String orderId)
     */
    public void removeOrder(final String orderId) {
        dao.removeOrder(new Long(orderId));
    }

	public List getOrdersByOrderNo(String orderNo) {
		// TODO Auto-generated method stub
		return dao.getOrdersByOrderNo(orderNo);
	}
    
    
}
